package interfaces

import (
	"github.com/liyaozong/mengo/contracts/errors"
	"github.com/liyaozong/mengo/contracts/models"
)

type DBClient interface {
	CloseSession()

	AddDevice(d models.Device) (models.Device, errors.MenGo)
	DeleteDeviceById(id string) errors.MenGo
	DeleteDeviceByName(name string) errors.MenGo
	DevicesByServiceName(offset int, limit int, name string) ([]models.Device, errors.MenGo)
	DeviceIdExists(id string) (bool, errors.MenGo)
	DeviceNameExists(id string) (bool, errors.MenGo)
	DeviceById(id string) (models.Device, errors.MenGo)
	DeviceByName(name string) (models.Device, errors.MenGo)
	AllDevices(offset int, limit int, labels []string) ([]models.Device, errors.MenGo)
	DevicesByProfileName(offset int, limit int, profileName string) ([]models.Device, errors.MenGo)
	UpdateDevice(d models.Device) errors.MenGo
	DeviceCountByLabels(labels []string) (uint32, errors.MenGo)
	DeviceCountByProfileName(profileName string) (uint32, errors.MenGo)
	DeviceCountByServiceName(serviceName string) (uint32, errors.MenGo)
}
